<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var num = [10,20,30,40,50,'java','php','mysql'];
    for(i=0;i<num.length;i++){
        document.write('num['+i+']='+num[i]+"<br>");
    }
    document.write('<hr><br><br>');

    //foreach    在java 编程  for(a : num){}
    for(a in num){
        document.write('num['+a+']='+num[a]+"<br>");
    }
    document.write('<hr><br><br>');
    for(t in window){
        document.write(t+"<br>");
    }
    document.write('<hr><br><br>');

    num.forEach(function(e,i){
        //document.write(i);//01234567
        document.write(e);//10,20,30,40 代表元素值
    })


</script>
</body>
</html>